#!/usr/bin/python

import datetime as dt
import os
import shutil as sh
import subprocess as sbp

present = dt.datetime.now()
ymd = '_'.join(map(str, [present.year, present.month, present.day]))
wall_time = '_'+str(present.hour) + ':' + str(present.minute).rjust(2,'0')
timestamp = ymd + wall_time

#create directories to keep output organized
#high-level directory == timestamp
os.makedirs(timestamp+'/'+'pickled_output') #useful directory
os.mkdir(timestamp+'/'+'output_arrays') #useful directory

#copy in a bunch of files
sh.copy('jobscript.sh',timestamp)
sh.copy('get_trajectory.py',timestamp)
sh.copy('trajectory_input_file',timestamp)

#go to timestamp directory
os.chdir(timestamp)

#run job
for idx in range(900):
    sbp.call(['python', 'get_trajectory.py', str(idx)])

